﻿
using System.Text;
using System.Security.Cryptography;

#if UNITY_EDITOR
using UnityEditor;
#endif


public static class Util
{
    public static string MD5Encrypt(string str)
    {
        var md5 = new MD5CryptoServiceProvider();
        var bytes = Encoding.ASCII.GetBytes(str);
        var encoded = md5.ComputeHash(bytes);
        var sb = new StringBuilder();
        foreach (var c in encoded)
            sb.Append(c.ToString("x2"));
        return sb.ToString();
    }
}